package com.example.MastAndSlave.controller.mybatis;

import com.example.MastAndSlave.domain.User;
import com.example.MastAndSlave.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/MybatisTest")
public class MybatisTestController {

    @Autowired
    private UserMapper userMapper;


    @GetMapping("/test01")
    @ResponseBody
    public String test(){
        User user = userMapper.selectUserById(1);
        return user.toString();
    }
}
